package com.wxapp.dispatch.api.pojo.vo.dispatch;

import com.wxapp.common.base.util.jackson.JacksonUtil;
import com.wxapp.common.constant.constant.LoginConstant;
import com.wxapp.common.util.check.CheckUtil;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author lgl
 * @Description
 * @Datetime 2023/5/26 20:45
 * @Modified By
 */
@Data
public class QDispatchVo extends QBaseVo {

    private Map mapHearder=new HashMap();

    private String token;

    public Map getMapHeader() {
        if (this.mapHearder == null && getHeader() != null) {
            this.mapHearder = JacksonUtil.parseObject(getHeader(), Map.class);
        }
        if (this.mapHearder == null && getHeader() == null) {
            this.mapHearder = new HashMap();
        }
        if (this.mapHearder != null && CheckUtil.isNotNullString(this.token)) {
            this.mapHearder.put(LoginConstant.INTERNAL_TOKEN_KEY, this.token);
        }
        return this.mapHearder;
    }
}
